<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateEnTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //网站主要信息
        Schema::create('en_sys_info', function (Blueprint $table) {
            $table->increments('id')->comment('字段id');
            $table->string('content')->nullable()->comment('需修改的内容');
            $table->string('url')->nullable()->comment('跳转链接');
            $table->string('type',64)->nullable()->comment('type');
            $table->softDeletes();
            $table->timestamps();
        });

        //底部栏
        Schema::create('en_footer_menu', function (Blueprint $table) {
            $table->increments('id')->comment('标识');
            $table->integer("pid")->default(0)->commit("父级id");
            $table->string('name',50)->nullable()->comment('名称');
            $table->string('link')->nullable()->comment("跳转链接");
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
        });

        //关于我们
        Schema::create('en_about_us', function (Blueprint $table) {
            $table->increments('id');
            $table -> integer('user_id')        ->default(0)->comment('写作人');
            $table -> string("title")           ->nullable()->comment('标题');
            $table -> text   ('content')        ->nullable()->comment('内容');
            $table -> integer('is_show')        ->default(0)->comment('是否显示');
            $table -> integer('classify_id')    ->default(0)->comment('分类id');
            $table -> softDeletes();
            $table->timestamps();
        });

        //人才招聘
        Schema::create('en_human_resources', function (Blueprint $table) {
            $table->increments('id');
            $table -> integer('user_id')        ->default(0)->comment('写作人');
            $table -> string("title")           ->nullable()->comment('标题');
            $table -> text   ('content')        ->nullable()->comment('内容');
            $table -> integer('is_show')        ->default(0)->comment('是否显示');
            $table -> integer('classify_id')    ->default(0)->comment('分类id');
            $table -> softDeletes();
            $table->timestamps();
        });

        //产品表
        Schema::create('en_goods_product', function (Blueprint $table) {
            $table->increments('id');
            $table -> string("name")            ->nullable()->comment('产品名称');
            $table -> string('ssn')             ->nullable()->comment('产品编号');
            $table -> decimal('m_price')        ->default(0)->comment('市场价');
            $table -> decimal('s_price')        ->default(0)->comment('销售价');
            $table -> integer('thumb_id')       ->default(0)->comment('商品缩略图');
            $table -> string('desc')            ->nullable()->comment('描述');
            $table -> text   ('content')        ->nullable()->comment('内容');
            $table -> integer('stock')          ->default(0)->comment('商品库存');
            $table -> integer('sale_count')     ->default(0)->comment('销售数量');
            $table -> integer('is_shop')        ->default(0)->comment('是否上架');
            $table -> integer('is_new')         ->default(0)->comment('是否首页显示，0：否 1：是');
            $table -> integer('classify_id')    ->default(0)->comment('分类id');
            $table -> integer('sort')           ->default(1)->comment('商品排序，整数，数字越低排序越前');
            $table -> softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
